﻿using Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GameConfig
{
    /// <summary>
    /// 配置表管理类
    /// </summary>
    public class ConfigManager:Singleton<ConfigManager>
    {
        //存放充值配置表的字典
        public Dictionary<string, Charge> dicCharge = new Dictionary<string, Charge>();
        //存放xx配置表的字典

        //配置表资源路径
        public string ResPath = "";

        /// <summary>
        /// 获取配置表的全路径
        /// </summary>
        /// <param name="fileName">配置表的名称</param>
        /// <returns></returns>
        public string GetPath(string fileName)
        {
            return ResPath + "\\" + fileName;
        }

        /// <summary>
        /// 加载所有的配置表到内存中
        /// </summary>
        public void LoadAllCfg()
        {
            //加载充值配置表
            dicCharge = JsonTool.DeSerializeCfgToDic<Charge>(GetPath("Charge.json"));
            //加载关卡配置表
            //加载xx配置表
        }
    }


}
